var summary=document.querySelector(".summary");
var technology=document.querySelector(".technology");
var pic1=document.querySelector(".pic1");
var pic2=document.querySelector(".pic2");
var fixedbtn=document.querySelector(".fixed-btn");
var detailtab=document.querySelector(".detailtab");
var fixedbtndiv=document.querySelector(".fixed-btn-div");
var detaitab=document.querySelector(".detail-tab"); 
var selc=$(".selectColor li");
var sels=$(".selectSpec li");
var tp=detailtab.offsetTop;
var selp=$(".selectPackage li");
var selm=$(".main_left_thumb li");
summary.addEventListener("click",function(){
	pic1.style.display="block";
	pic2.style.display="none";
	summary.className="summary active";
	technology.className="technology";
})
technology.addEventListener("click",function(){
	pic2.style.display="block";
	pic1.style.display="none";
	summary.className="summary";
	technology.className="technology  active";
})
window.addEventListener("scroll",function(){
	var t=document.documentElement.scrollTop;
	if(t>=60){
		fixedbtn.style.display="block";
		getComputedStyle(fixedbtn).display;
		fixedbtn.style.height="60px";
		
		if(t>=tp){
			detailtab.style.position="absolute";
			detailtab.style.top=0;
			fixedbtndiv.appendChild(detailtab);
		}else{
			detailtab.style.position="";
			detaitab.appendChild(detailtab);
		}
	}else{
		fixedbtn.style.height="0";	
		fixedbtn.style.display="none";
	}
});
selc.on("click",function(){
	$(this).addClass("select").siblings().removeClass("select");
	switch (selc.index(this)){
		case 0:
			selm.parent().siblings()[0].src="img/xiangqing/149725499137.jpg";
			selm.children()[0].src="img/xiangqing/149725499137.jpg";
			selm.children()[1].src="img/xiangqing/149725485894.jpg";
			selm.children()[2].src="img/xiangqing/149725485837.jpg";
			selm.children()[3].src="img/xiangqing/149725485825.jpg";
			break;
		case 1:
			selm.parent().siblings()[0].src="img/xiangqing/149674175132.jpg";
			selm.children()[0].src="img/xiangqing/149674175132.jpg";
			selm.children()[1].src="img/xiangqing/149631340417.jpg";
			selm.children()[2].src="img/xiangqing/14963134044.jpg";
			selm.children()[3].src="img/xiangqing/149631340558.jpg";
			break;
		case 2:
			selm.parent().siblings()[0].src="img/xiangqing/150094954758.jpg";
			selm.children()[0].src="img/xiangqing/150094954758.jpg";
			selm.children()[1].src="img/xiangqing/149631333161.jpg";
			selm.children()[2].src="img/xiangqing/149631333129.jpg";
			selm.children()[3].src="img/xiangqing/149631333156.jpg";
			break;
		case 3:
			selm.parent().siblings()[0].src="img/xiangqing/150094951146.jpg";
			selm.children()[0].src="img/xiangqing/150094951146.jpg";
			selm.children()[1].src="img/xiangqing/150094906852.jpg";
			selm.children()[2].src="img/xiangqing/150094906864.jpg";
			selm.children()[3].src="img/xiangqing/150094906871.jpg";
			break;
	}
	console.log(selm);
});
sels.on("click",function(){
	$(this).addClass("select").siblings().removeClass("select");
});
selp.on("click",function(){
	$(this).addClass("select").siblings().removeClass("select");
});
selm.on("click",function(){
	$(this).addClass("select").siblings().removeClass("select");
	$(this).parent().siblings()[0].src=$(this).children()[0].src;
	
});
